import { CommonActions } from '@react-navigation/native';
let navigator;

export const setNavigator = (nav) => {
  navigator = nav;
  console.log(navigator);
};

export const navigate = (routeName, params) => {
  // navigator.dispatch(
  //   CommonActions.navigate({
  //     name: routeName,
  //     params,
  //   })
  // );
  console.log(routeName);
  console.log(params);
  navigator.navigate({
    name: routeName,
    params,
  });
};
